#!/bin/sh

output=~/Screenshots/
mkdir -p "$output"

tmpfile="$(mktemp)"
xscreenshot | ff2png > "$tmpfile"

filename=$(echo | dmenu -p "Filename:")
counter=""

if [ -f "$output$filename".png ];
then
    counter="0"
    while [ -f "$output$filename$counter".png ]; do
        let counter=counter+1
    done
fi

mv "$tmpfile" "$output$filename$counter".png

